package easy;

public class Solution_1217 {

    public int minCostToMoveChips(int[] position) {

        int count_1 = 0, count_2 = 0;
        for (int num : position) {
            if (num % 2 == 0) {
                count_1++;
            } else {
                count_2++;
            }
        }
        return Math.min(count_1, count_2);
    }

    public static void main(String[] args) {
        Solution_1217 model = new Solution_1217();
        System.out.println(model.minCostToMoveChips(new int[]{1, 2, 3}));
        System.out.println(model.minCostToMoveChips(new int[]{2, 2, 2, 3, 3}));
        System.out.println(model.minCostToMoveChips(new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}));
    }
}
